-- Copyright 2016 The Cartographer Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

-- 包含基础配置文件
include "map_builder.lua"
include "trajectory_builder.lua"

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  -- 地图坐标系，通常设置为"map"
  map_frame = "map",
  -- 跟踪坐标系，设置为imu_link表示使用IMU作为跟踪参考
  -- 注意：需要确保TF树中存在imu_link到base_footprint的转换
  tracking_frame = "imu_link",
  -- 发布坐标系，设置为odom表示发布到odom坐标系
  published_frame = "base_footprint",
  -- odom坐标系名称
  odom_frame = "odom",
  -- 是否提供odom帧，纯定位模式下通常设为false
  provide_odom_frame = false,
  -- 是否将位姿投影到2D平面，纯定位模式下建议设为true
  publish_frame_projected_to_2d = true,
  -- 是否使用位姿外推器，纯定位模式下建议启用
  use_pose_extrapolator = true,
  -- 是否使用里程计数据，纯定位模式下通常设为false
  use_odometry = false,
  -- 是否使用GPS数据
  use_nav_sat = false,
  -- 是否使用路标数据
  use_landmarks = false,
  -- 激光扫描相关配置
  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  num_point_clouds = 0,
  -- TF查找超时时间，单位秒
  lookup_transform_timeout_sec = 0.2,
  -- 子地图发布周期
  submap_publish_period_sec = 0.3,
  -- 位姿发布周期，纯定位模式下可以适当降低以提高实时性
  pose_publish_period_sec = 5e-3,
  -- 轨迹发布周期
  trajectory_publish_period_sec = 30e-3,
  -- 各种数据的采样比例
  rangefinder_sampling_ratio = 1.,
  odometry_sampling_ratio = 1.,
  fixed_frame_pose_sampling_ratio = 1.,
  -- IMU数据采样比例，使用IMU时设为1.0
  imu_sampling_ratio = 0.0,
  landmarks_sampling_ratio = 1.,
}

-- 使用2D轨迹构建器
MAP_BUILDER.use_trajectory_builder_2d = true
-- 累积的激光数据数量，纯定位模式下可以适当减小
TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 1

return options